<template>
  <svg :style="{ width, height }">
    <use :xlink:href="prefix + name" :fill="color"></use>
  </svg>
</template>
  
  <script setup lang="ts">
import { defineProps } from "vue";
// 接收父组件传递过来的参数
defineProps({
  prefix: {
    type: String,
    default: "#icon-",
  },
  name: String,
  // 接收父组件的传递的颜色
  color: {
    type: String,
    default: "",
  },
  //svg宽度
  width: {
    type: String,
    default: "16px",
  },
  //svg高度
  height: {
    type: String,
    default: "16px",
  },
});
</script>
  <style>
</style>